#include "TBVec2.h"

namespace tb
{

	TB_INLINE Pos2::Pos2()
	{

	}


	TB_INLINE Pos2::Pos2(int a_X, int a_Y)
	{
		x = a_X;
		y = a_Y;
	}

	TB_INLINE Pos2::Pos2(const Pos2& a_Other)
	{
		x = a_Other.x;
		y = a_Other.y;
	}

	TB_INLINE Pos2::Pos2(const Vec2& a_Other)
	{
		x = (int)a_Other.x;
		y = (int)a_Other.y;
	}

	TB_INLINE Pos2::~Pos2()
	{

	}

	// ================================
	// Operators
	// ================================

	TB_INLINE Pos2& Pos2::operator - ()
	{
		x = -x;
		y = -y;

		return *this;
	}

	TB_INLINE Pos2& Pos2::operator += (const Pos2& a_Other)
	{
		x += a_Other.x;
		y += a_Other.y;

		return *this;
	}

	TB_INLINE Pos2 Pos2::operator + (const Pos2& a_Other) const
	{
		return Pos2(
			x + a_Other.x,
			y + a_Other.y
		);
	}

	TB_INLINE Pos2& Pos2::operator -= (const Pos2& a_Other)
	{
		x -= a_Other.x;
		y -= a_Other.y;

		return *this;
	}

	TB_INLINE Pos2 Pos2::operator - (const Pos2& a_Other) const
	{
		return Pos2(
			x - a_Other.x,
			y - a_Other.y
		);
	}

	TB_INLINE Pos2& Pos2::operator *= (int a_Scalar)
	{
		x *= a_Scalar;
		y *= a_Scalar;

		return *this;
	}

	TB_INLINE Pos2& Pos2::operator *= (const Pos2& a_Other)
	{
		x *= a_Other.x;
		y *= a_Other.y;

		return *this;
	}

	TB_INLINE Pos2 Pos2::operator * (int a_Scalar) const
	{
		return Pos2(
			x * a_Scalar,
			y * a_Scalar
		);
	}

	TB_INLINE Pos2 Pos2::operator * (const Pos2& a_Other) const
	{
		return Pos2(
			x * a_Other.x,
			y * a_Other.y
		);
	}

	TB_INLINE Pos2& Pos2::operator /= (int a_Scalar)
	{
		x /= a_Scalar;
		y /= a_Scalar;

		return *this;
	}

	TB_INLINE Pos2& Pos2::operator /= (const Pos2& a_Other)
	{
		x /= a_Other.x;
		y /= a_Other.y;

		return *this;
	}

	TB_INLINE Pos2 Pos2::operator / (int a_Scalar) const
	{
		return Pos2(
			x / a_Scalar,
			y / a_Scalar
		);
	}

	TB_INLINE Pos2 Pos2::operator / (const Pos2& a_Other) const
	{
		return Pos2(
			x / a_Other.x,
			y / a_Other.y
		);
	}

}; // namespace tb